package main

import (
	"shop-admin/app"
	"shop-admin/startup"
	"shop-common/engine"
)

const SHOP_ADMIN = "shop-admin"

//go:generate go env -w GO111MODULE=on
//go:generate go env -w GOPROXY=https://goproxy.cn,direct
//go:generate go mod tidy
//go:generate go mod download

// @title 商城后台 API
// @version 0.0.1
// @description 商城后台api
// @contact.name bob
// @contact.url https://www.cdbob.cn
// @contact.email 422720735@qq.com
// @host localhost:9001
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization
func main() {
	application := &engine.WEBApplication{
		Application: &engine.Application{
			Name:      SHOP_ADMIN,
			SetupApp:  startup.SetupApp,
			SetupVars: startup.SetupVars,
		},
		RegisterHttpRoute: startup.RegisterHttpRoute,
		CreateTables:      startup.Migrate,
		ServiceImpl:       startup.RegisterService,
		CronScheduler:     startup.GenCronJobs,
	}
	app.RunApplication(application)
}

//Golang 的 “omitempty” 关键字略解
//https://www.jianshu.com/p/a2ed0d23d1b0

//https://haicoder.net/golang/golang-string-containsany.html

//https://blog.csdn.net/qq_18451629/article/details/111448876
